<template>
  <div>
    <el-table
      :data="data"
      :border="true"
      :header-cell-class-name="$style.tableHeaderCell"
      v-loading="loading"
      tooltip-effect="dark"
      style="width: 100%"
      ref="storeTable"
    >
      <el-table-column align="center" min-width="150px" prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
      <el-table-column align="center" min-width="100px" prop="city" label="城市"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="scriptType" label="脚本类型"></el-table-column>
      <el-table-column align="center" min-width="100px" prop="status" label="状态">
        <template slot-scope="scope">
          <div v-if="scope.row.status === 'ON'" style="color: #13ce66">
            启用
          </div>
          <div v-if="scope.row.status === 'OFF'" style="color: red">
            禁用
          </div>
        </template>
      </el-table-column>
      <el-table-column align="center" min-width="150px" prop="operationManager" label="操作">
        <template slot-scope="scope">
          <span style="cursor:pointer;color: #409eff;" @click="onOpenDetailModal(scope.row)">
            编辑
          </span>
          <span v-if="scope.row.status == 'ON'" style="cursor:pointer;color: #409eff;" @click="onDisable(scope.row)">
            禁用
          </span>
          <span v-if="scope.row.status == 'OFF'" style="cursor:pointer;color: #409eff;" @click="onEnable(scope.row)">
            启用
          </span>
        </template>
      </el-table-column>
    </el-table>
    <div :class="$style.tablePagination">
      <el-pagination
        @size-change="onPageSizeChange"
        @current-change="onPageNumChange"
        :current-page="currentPage"
        :page-sizes="[10, 15, 20, 50]"
        :page-size="pageSize"
        layout="total, prev, pager, next, sizes"
        :total="total"
      />
    </div>
  </div>
</template>
<style lang="scss" module>
@import './index.module.scss';
</style>

<script>
import Index from './index';
export default Index;
</script>
